﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EmailSender;
using Ciripescu_WebRole.BL;

namespace Ciripescu_WebRole
{
    public partial class contact : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSend_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
               MailSender.Send(txtEmail.Text,
                                "contact@bitstarsolutions.com",
                                txtSubject.Text,
                                "Email sent from web interface under ip=" + Request.UserHostAddress + "\r\n<br>" + txtMessage.Text);
               divErrors.InnerHtml = "Email trimis.:D.";
            }
            catch (Exception ex)
            {
                divErrors.InnerHtml = "...ceva s-a intamplat si mailul nu l-am putut trimite.";
            }
        }
    }
}
